package com.config.client;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ConfigTestController {

	// 远程配置服务器读取配置
    @Value("${env.name}")
    private String envName;
    
    // 本地配置文件读取配置
    @Value("${server.port}")
    private String port;
	
	@RequestMapping("/printEnv")
	public String printEnv(){
		return envName;
	}
	
	@RequestMapping("/printPort")
	public String printPort(){
		return port;
	}
}
